package my.study.java.lang.String;

public class StringEqualEx01 {
	/**
	 * a b 相等 其他都不等，注意 case 1
	 * @param args
	 */
	public static void main(String[] args) {
		String a = "abc";
		String b = "abc";
		String c = new String(a);
		String d = new String(a);
		String e = new String("abc");
		String f = new String("abc");
		String g = new String("a" + "bc");
		String h = new String("a" + "bc");
		System.out.println("1: " + a == b);
		
		
		System.out.println("2: " + (a == b));
		System.out.println("3: " + (a == c));
		System.out.println("4: " + (a == e));
		System.out.println("5: " + (a == g));
		
		System.out.println("6: " + (c == d));
		System.out.println("7: " + (c == e));
		System.out.println("8: " + (c == g));
		
		System.out.println("9: " + (e == f));
		System.out.println("10: " + (e == g));
		
		System.out.println("11: " + (g == h));
	}

}
